<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>抽奖管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
	
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/wechat/lottery/expandLotteryList?sourceId=${lottery.sourceId}&sourceType=3&type=7">三级推广奖品</a></li>
		<li><a href="${ctx}/wechat/lottery/expandLotteryForm?sourceId=${lottery.sourceId}&sourceType=3&type=7">三级推广奖品添加</a></li>
	</ul>
	
	<form:form id="searchForm" modelAttribute="lottery" action="${ctx}/wechat/lottery/expandLotteryList" method="post" class="breadcrumb form-search">
		<form:hidden path="type" value="7"/>
		<form:hidden path="sourceId" value="${lottery.sourceId}"/>
		<form:hidden path="sourceType" value="3"/>
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<label>名称 ：</label><form:input path="name" htmlEscape="false" maxlength="50" class="input-medium"/>
		&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form:form>
	<tags:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<th>名称</th>
		<th>类型</th><th>奖品类型</th><th>有效天数</th><th>领取区间上限</th><th>领取区间下限</th><shiro:hasPermission name="wechat:lottery:edit"><th>操作</th></shiro:hasPermission></tr></thead>
		<tbody>
		<c:forEach items="${page.list}" var="lottery">
			<tr>
				<td>${lottery.name}</td>
				<td><c:if test="${lottery.type eq 7}">三级推广奖品</c:if></td>
				<td>
					<c:if test="${lottery.lotteryType eq 1 }">系统二维码</c:if>
					<c:if test="${lottery.lotteryType eq 2 }">微信卡券</c:if>
					<c:if test="${lottery.lotteryType eq 3 }">商户优惠券</c:if>
				</td>
				<td>${lottery.appointDayNum}</td>
				<td>${lottery.upper}</td>
				<td>${lottery.lower}</td>
				
				<td>
    				<a href="${ctx}/wechat/lottery/expandLotteryForm?id=${lottery.id}">修改</a>
					<a href="${ctx}/wechat/lottery/expandLotteryDelete?id=${lottery.id}&sourceId=${lottery.sourceId}" onclick="return confirmx('确认要删除该抽奖吗？', this.href)">删除</a>
				</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>
